package com.work.farm.dao;

import com.work.farm.pojo.TCustFarmEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.common.Mapper;

public interface FarmDao extends Mapper<TCustFarmEntity> {

    @Insert("insert into t_cust_farm values(null,#{farmid},#{code},#{name},#{position},#{status})")
    void add(TCustFarmEntity tCustFarmEntity);

    @Select("select * from t_cust_farm where id =#{id}")
    TCustFarmEntity findById(Long id);

    @Update("update t_cust_farm set code=#{code},name=#{name}, status = #{status} where id = #{id}")
    void updateFarm(TCustFarmEntity tCustFarmEntity);

}
